package main

import (
	"fmt"
	"gogogo/web/service"
	"net/rpc"
)

func main() {
	client, err := rpc.DialHTTP("tcp", "localhost:1234")
	if err != nil {
		fmt.Println("connect server fail.", err.Error())
		return
	}
	args := &service.Args{M: 8, N: 9}
	var rs int
	err = client.Call("Args.Multiply", args, &rs)
	if err != nil {
		fmt.Println("call remote method fail.", err.Error())
		return
	}
	fmt.Printf("%d * %d = %d\n", args.N, args.M, rs)
}
